// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line standard/object-curly-even-spacing
import { get, post, deletes, put } from './axios.js'
const http = 'http://www.zgweiqu.com/v7'
// const http = '/v7'
// const http = 'http://cs.zgmjzw.com/v7' // 测试地址
const myregMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9]|16[0-9])[0-9]{8}$/
const getRSACode = (params) => {
  return get(`${http}/common/rsaEncrypt`, { sign: params })
}
const webLogin = (params) => {
  // eslint-disable-next-line no-undef
  return post(`${http}/user/signin`, { secret: params })
}
const getUserInfo = params => {
  return get(`${http}/user/user`, { secret: params })
}
const userLogout = params => {
  return get(`${http}/user/logout`, { secret: params })
}
const getMainOnline = params => {
  return get(`${http}/main/machine`, { secret: params })
}
const getMainSales = params => {
  return get(`${http}/main/sales`, { secret: params })
}
const getMainGoods = params => {
  return get(`${http}/main/goods`, { secret: params })
}
const getMainOrder = params => {
  return get(`${http}/main/newest`, { secret: params })
}
const getMainRegion = params => {
  return get(`${http}/main/regions`, { secret: params })
}
const getMainProvincetop = params => {
  return get(`${http}/main/provincetop`, { secret: params })
}
const getSummaryMachine = params => {
  return get(`${http}/summary/machine`, { secret: params })
}
const getSummarySales = params => {
  return get(`${http}/summary/sales`, { secret: params })
}
const getSummaryMember = params => {
  return get(`${http}/summary/member`, { secret: params })
}
const getSummaryData = params => {
  return get(`${http}/summary/data`, { secret: params })
}
const getRangking = params => {
  return get(`${http}/summary/ranking`, { secret: params })
}
const getAnalysisSales = params => {
  return get(`${http}/analysis/sales`, { secret: params })
}
const getAnalysisGoods = params => {
  return get(`${http}/analysis/goods`, { secret: params })
}
const getSales = params => {
  return get(`${http}/chart/sales`, { secret: params })
}
const getSalesTime = params => {
  return get(`${http}/chart/salestime`, { secret: params })
}
const getQuality = params => {
  return get(`${http}/chart/quality`, { secret: params })
}
const getQualityTime = params => {
  return get(`${http}/chart/qualitytime`, { secret: params })
}
const getMember = params => {
  return get(`${http}/chart/member`, { secret: params })
}
const getMemberTime = params => {
  return get(`${http}/chart/membertime`, { secret: params })
}
const getGoodsChart = params => {
  return get(`${http}/chart/goods`, { secret: params })
}
const getProvince = params => {
  return get(`${http}/filter/province`, { secret: params })
}
const getCity = params => {
  return get(`${http}/filter/city`, { secret: params })
}
const getSite = params => {
  return get(`${http}/filter/site`, { secret: params })
}
const getRegion = params => {
  return get(`${http}/filter/region`, { secret: params })
}
const getMachine = params => {
  return get(`${http}/filter/machine`, { secret: params })
}
const getPreferential = params => {
  return get(`${http}/filter/preferential`, { secret: params })
}
const getPaytype = params => {
  return get(`${http}/filter/paytype`, { secret: params })
}
export default {
  get,
  deletes,
  put,
  post,
  webLogin,
  getUserInfo,
  userLogout,
  myregMobile,
  getRSACode,
  getMainOnline,
  getMainSales,
  getMainGoods,
  getMainRegion,
  getMainProvincetop,
  getSummaryMachine,
  getSummarySales,
  getSummaryMember,
  getSummaryData,
  getRangking,
  getAnalysisSales,
  getProvince,
  getCity,
  getSite,
  getRegion,
  getMachine,
  getPreferential,
  getPaytype,
  getAnalysisGoods,
  getSales,
  getSalesTime,
  getQuality,
  getQualityTime,
  getMember,
  getMemberTime,
  getGoodsChart,
  getMainOrder
}
